home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / dfue / avmnfax / source / defaultsender.avmsrc < prev    next >
Text File  |  1995-03-09  |  13KB  |  661 lines

  1. startrecord=true
  2. label=
  3. nodetype=7
  4. filename=avm:rexx/stdhead.avm
  5. nextactiontype=3
  6. nextactionaction=
  7. endrecord=true
  8. startrecord=true
  9. label=
  10. nodetype=8
  11. line1=parse upper arg servername mailbox magiccookie sendType .
  12. line2=
  13. line3=
  14. line4=
  15. line5=
  16. line6=
  17. line7=
  18. line8=
  19. line9=
  20. line10=
  21. nextactiontype=3
  22. nextactionaction=
  23. endrecord=true
  24. startrecord=true
  25. label=
  26. nodetype=14
  27. comment=If type is voice, goto sendVoice.  Otherwise, go to sendFax
  28. nextactiontype=3
  29. nextactionaction=
  30. endrecord=true
  31. startrecord=true
  32. label=
  33. nodetype=8
  34. line1=call loadLogEntry(mailbox, magiccookie)
  35. line2=
  36. line3=
  37. line4=
  38. line5=
  39. line6=
  40. line7=
  41. line8=
  42. line9=
  43. line10=
  44. nextactiontype=3
  45. nextactionaction=
  46. endrecord=true
  47. startrecord=true
  48. label=
  49. nodetype=8
  50. line1=if log.returnNumber = '' & upper(sendType) ~= 'MANUAL' then do
  51. line2=  log.returnStatus = 'No Tel#'
  52. line3=  log.returnRetry = 0
  53. line4=  signal sendVoiceDone
  54. line5=end
  55. line6=if log.filename = '' then do
  56. line7=  log.returnStatus = 'No File'
  57. line8=  log.returnRetry = 0
  58. line9=  signal sendVoiceDone
  59. line10=end
  60. nextactiontype=3
  61. nextactionaction=
  62. endrecord=true
  63. startrecord=true
  64. label=
  65. nodetype=8
  66. line1=if upper(sendType) = 'MANUAL' then numberToDial = 'MAN!'; else numberToDial = log.returnNumber
  67. line2=
  68. line3=
  69. line4=if upper(log.type) = 'VOICE' then signal sendVoice
  70. line5=else if upper(log.type) = 'FAX' then signal sendFax
  71. line6=
  72. line7=log.returnstatus = 'Not Voice/Fax'
  73. line8=log.returnretry = 0
  74. line9=
  75. line10=
  76. nextactiontype=0
  77. nextactionaction=sendVoiceDone
  78. endrecord=true
  79. startrecord=true
  80. label=
  81. nodetype=14
  82. comment=Going to send a voice file
  83. nextactiontype=3
  84. nextactionaction=
  85. endrecord=true
  86. startrecord=true
  87. label=
  88. nodetype=14
  89. comment=Dial up to three times
  90. nextactiontype=3
  91. nextactionaction=
  92. endrecord=true
  93. startrecord=true
  94. label=sendVoice
  95. nodetype=8
  96. line1=numTries = 3
  97. line2=
  98. line3=
  99. line4=
  100. line5=
  101. line6=
  102. line7=
  103. line8=
  104. line9=
  105. line10=
  106. nextactiontype=3
  107. nextactionaction=
  108. endrecord=true
  109. startrecord=true
  110. label=sendVoiceRedial
  111. nodetype=15
  112. number=log.returnnumber
  113. busyactiontype=0
  114. busyactionaction=sendVoiceAgain
  115. timedoutactiontype=0
  116. timedoutactionaction=sendVoiceAgain
  117. abortactiontype=2
  118. abortactionaction=log.returnStatus = 'Abort'; log.returnRetry = 0; signal sendVoiceDone
  119. erroractiontype=2
  120. erroractionaction=log.returnStatus = 'Error'; log.returnRetry = 0; signal sendVoiceDone
  121. nextactiontype=0
  122. nextactionaction=sendVoiceConnected
  123. endrecord=true
  124. startrecord=true
  125. label=sendVoiceAgain
  126. nodetype=5
  127. mode=2
  128. nextactiontype=3
  129. nextactionaction=
  130. endrecord=true
  131. startrecord=true
  132. label=
  133. nodetype=16
  134. timeout=5
  135. abortactiontype=2
  136. abortactionaction=log.returnStatus = 'Abort'; log.returnRetry = 0; signal sendVoiceDone
  137. erroractiontype=2
  138. erroractionaction=log.returnStatus = 'Error'; log.returnRetry = 0; signal sendVoiceDone
  139. nextactiontype=2
  140. nextactionaction=
  141. endrecord=true
  142. startrecord=true
  143. label=sendVoiceRetry
  144. nodetype=8
  145. line1=numTries = numTries - 1
  146. line2=if numTries <= 0 then do
  147. line3=  log.returnStatus = 'Busy'
  148. line4=  signal sendVoiceDone
  149. line5=end
  150. line6=
  151. line7=
  152. line8=
  153. line9=
  154. line10=
  155. nextactiontype=0
  156. nextactionaction=sendVoiceRedial
  157. endrecord=true
  158. startrecord=true
  159. label=sendVoiceConnected
  160. nodetype=8
  161. line1=actualFileName = log.fileName
  162. line2=if verify(actualFileName, '/:', 'M') = 0 then
  163. line3=  actualFileName = voiceFile(mailbox, actualFileName)
  164. line4=
  165. line5=actualAltFileName = ''
  166. line6=if symbol('log.altFileName') = 'VAR' then actualAltFileName = log.altFileName
  167. line7=actualAltFileName = voiceFile(mailbox, actualAltFileName)
  168. line8=
  169. line9=
  170. line10=
  171. nextactiontype=3
  172. nextactionaction=
  173. endrecord=true
  174. startrecord=true
  175. label=
  176. nodetype=8
  177. line1=numTimes = 5
  178. line2=
  179. line3=
  180. line4=
  181. line5=
  182. line6=
  183. line7=
  184. line8=
  185. line9=
  186. line10=
  187. nextactiontype=3
  188. nextactionaction=
  189. endrecord=true
  190. startrecord=true
  191. label=sendVoiceRepeat
  192. nodetype=8
  193. line1=if actualAltFileName = '' then signal sendVoiceSkipIntro
  194. line2=
  195. line3=
  196. line4=
  197. line5=
  198. line6=
  199. line7=
  200. line8=
  201. line9=
  202. line10=
  203. nextactiontype=3
  204. nextactionaction=
  205. endrecord=true
  206. startrecord=true
  207. label=
  208. nodetype=1
  209. filename=actualAltFileName
  210. comment=
  211. keyactiontype=3
  212. keyactionaction=
  213. faxactiontype=2
  214. faxactionaction=log.returnStatus = 'Fax?'; log.returnRetry = 0; signal sendVoiceDone
  215. dataactiontype=2
  216. dataactionaction=log.returnStatus = 'Data?'; log.returnRetry = 0; signal sendVoiceDone
  217. busyactiontype=2
  218. busyactionaction=if numTimes = 3 then signal sendVoiceAgain; else signal sendVoiceBusy
  219. abortactiontype=2
  220. abortactionaction=log.returnStatus = 'Abort'; log.returnRetry = 0; signal sendVoiceDone
  221. erroractiontype=3
  222. erroractionaction=
  223. nextactiontype=3
  224. nextactionaction=
  225. endrecord=true
  226. startrecord=true
  227. label=
  228. nodetype=12
  229. nextactiontype=3
  230. nextactionaction=
  231. endrecord=true
  232. startrecord=true
  233. label=sendVoiceSkipIntro
  234. nodetype=1
  235. filename=actualFileName
  236. comment=
  237. keyactiontype=3
  238. keyactionaction=
  239. faxactiontype=2
  240. faxactionaction=log.returnStatus = 'Fax?'; log.returnRetry = 0; signal sendVoiceDone
  241. dataactiontype=2
  242. dataactionaction=log.returnStatus = 'Data?'; log.returnRetry = 0; signal sendVoiceDone
  243. busyactiontype=2
  244. busyactionaction=if numTimes = 3 then signal sendVoiceAgain; else signal sendVoiceBusy
  245. abortactiontype=2
  246. abortactionaction=log.returnStatus = 'Abort'; log.returnRetry = 0; signal sendVoiceDone
  247. erroractiontype=2
  248. erroractionaction=log.returnStatus = 'Error'; log.returnRetry = 0; signal sendVoiceDone
  249. nextactiontype=3
  250. nextactionaction=
  251. endrecord=true
  252. startrecord=true
  253. label=
  254. nodetype=12
  255. nextactiontype=3
  256. nextactionaction=
  257. endrecord=true
  258. startrecord=true
  259. label=sendVoiceMenu
  260. nodetype=3
  261. filename='avm:voices/SendVoice'
  262. comment=Press 1 to repeat the message.  Or, press the * symbol to accept the delivery. [9=maintenance mode, 0=play menu]
  263. retries=1
  264. zeroactiontype=0
  265. zeroactionaction=sendVoiceMenu
  266. oneactiontype=0
  267. oneactionaction=sendVoiceRepeat
  268. twoactiontype=3
  269. twoactionaction=
  270. threeactiontype=3
  271. threeactionaction=
  272. fouractiontype=3
  273. fouractionaction=
  274. fiveactiontype=3
  275. fiveactionaction=
  276. sixactiontype=3
  277. sixactionaction=
  278. sevenactiontype=3
  279. sevenactionaction=
  280. eightactiontype=3
  281. eightactionaction=
  282. nineactiontype=2
  283. nineactionaction=log.returnRetry = 0; log.returnStatus = 'Sent+'; call updateLogEntry(mailbox, magicCookie); call aamaintenancemode(log.origmailbox); signal answerVoiceDone
  284. poundactiontype=0
  285. poundactionaction=answerVoiceDone
  286. staractiontype=0
  287. staractionaction=sendVoiceOK
  288. faxactiontype=2
  289. faxactionaction=log.returnStatus = 'Fax?'; log.returnRetry = 0; signal sendVoiceDone
  290. dataactiontype=2
  291. dataactionaction=log.returnStatus = 'Data?'; log.returnRetry = 0; signal sendVoiceDone
  292. busyactiontype=2
  293. busyactionaction=if numTimes = 3 then signal sendVoiceAgain; else signal sendVoiceBusy
  294. timedoutactiontype=3
  295. timedoutactionaction=
  296. abortactiontype=2
  297. abortactionaction=log.returnStatus = 'Abort'; log.returnRetry = 0; signal sendVoiceDone
  298. erroractiontype=2
  299. erroractionaction=log.returnStatus = 'Error'; log.returnRetry = 0; signal sendVoiceDone
  300. nextactiontype=3
  301. nextactionaction=
  302. endrecord=true
  303. startrecord=true
  304. label=
  305. nodetype=8
  306. line1=numTimes = numTimes - 1
  307. line2=if numTimes <= 0 then do
  308. line3=  signal sendVoiceTimedOut
  309. line4=end
  310. line5=
  311. line6=
  312. line7=
  313. line8=
  314. line9=
  315. line10=
  316. nextactiontype=0
  317. nextactionaction=sendVoiceRepeat
  318. endrecord=true
  319. startrecord=true
  320. label=sendVoiceTimedOut
  321. nodetype=8
  322. line1=log.returnStatus = 'Sent-TimedOut'
  323. line2=log.returnRetry = 0
  324. line3=
  325. line4=
  326. line5=
  327. line6=
  328. line7=
  329. line8=
  330. line9=
  331. line10=
  332. nextactiontype=0
  333. nextactionaction=sendVoiceDone
  334. endrecord=true
  335. startrecord=true
  336. label=sendVoiceBusy
  337. nodetype=8
  338. line1=log.returnRetry = 0
  339. line2=log.returnStatus = 'Sent-Busy'
  340. line3=
  341. line4=
  342. line5=
  343. line6=
  344. line7=
  345. line8=
  346. line9=
  347. line10=
  348. nextactiontype=0
  349. nextactionaction=sendVoiceDone
  350. endrecord=true
  351. startrecord=true
  352. label=sendVoiceOK
  353. nodetype=8
  354. line1=log.returnRetry = 0
  355. line2=log.returnStatus = 'Sent+'
  356. line3=
  357. line4=
  358. line5=
  359. line6=
  360. line7=
  361. line8=
  362. line9=
  363. line10=
  364. nextactiontype=3
  365. nextactionaction=
  366. endrecord=true
  367. startrecord=true
  368. label=sendVoiceDone
  369. nodetype=8
  370. line1=if log.returnRetry > 0 then do
  371. line2=  log.returnRetry = log.returnRetry - 1
  372. line3=  log.time = cTime() + log.returnInterval * 60
  373. line4=end
  374. line5=
  375. line6=call updateLogEntry(mailbox, magicCookie)
  376. line7=
  377. line8=
  378. line9=
  379. line10=
  380. nextactiontype=2
  381. nextactionaction=exit
  382. endrecord=true
  383. startrecord=true
  384. label=startup
  385. nodetype=14
  386. comment=Pressing 0 usually gets us here
  387. nextactiontype=3
  388. nextactionaction=
  389. endrecord=true
  390. startrecord=true
  391. label=answerVoiceDone
  392. nodetype=14
  393. comment=Pressing * gets us here
  394. nextactiontype=2
  395. nextactionaction=exit
  396. endrecord=true
  397. startrecord=true
  398. label=
  399. nodetype=14
  400. comment=Going to send a fax file
  401. nextactiontype=3
  402. nextactionaction=
  403. endrecord=true
  404. startrecord=true
  405. label=sendFax
  406. nodetype=8
  407. line1=options failat 50
  408. line2=signal off syntax
  409. line3=
  410. line4=
  411. line5=
  412. line6=
  413. line7=
  414. line8=
  415. line9=
  416. line10=
  417. nextactiontype=3
  418. nextactionaction=
  419. endrecord=true
  420. startrecord=true
  421. label=
  422. nodetype=5
  423. mode=1
  424. nextactiontype=3
  425. nextactionaction=
  426. endrecord=true
  427. startrecord=true
  428. label=
  429. nodetype=9
  430. baud=4
  431. bits=1
  432. parity=0
  433. stopbits=0
  434. handshaking=1
  435. erroractiontype=3
  436. erroractionaction=
  437. nextactiontype=3
  438. nextactionaction=
  439. endrecord=true
  440. startrecord=true
  441. label=
  442. nodetype=6
  443. mode=0
  444. nextactiontype=3
  445. nextactionaction=
  446. endrecord=true
  447. startrecord=true
  448. label=isTrapFax
  449. nodetype=8
  450. line1=faxprogram = getclip('AVMFaxProgram')
  451. line2=if upper(faxprogram) = 'TRAPFAX' then do
  452. line3=
  453. line4=
  454. line5=
  455. line6=
  456. line7=
  457. line8=
  458. line9=
  459. line10=
  460. nextactiontype=3
  461. nextactionaction=
  462. endrecord=true
  463. startrecord=true
  464. label=
  465. nodetype=8
  466. line1=mypara = 'File ' || log.filename || ' call ' || log.returnnumber
  467. line2=address command 'TrapFax:TFaxDoor >NIL:' mypara ' noowndev'
  468. line3=sendok = rc
  469. line4=log.returnstatus = 'Error'
  470. line5=
  471. line6=
  472. line7=
  473. line8=
  474. line9=
  475. line10=
  476. nextactiontype=3
  477. nextactionaction=
  478. endrecord=true
  479. startrecord=true
  480. label=isGPFax
  481. nodetype=8
  482. line1=end; else if upper(faxprogram) = 'GPFAX' & show('p', 'REXX_GPFAX') then do
  483. line2=
  484. line3=
  485. line4=
  486. line5=
  487. line6=
  488. line7=
  489. line8=
  490. line9=
  491. line10=
  492. nextactiontype=3
  493. nextactionaction=
  494. endrecord=true
  495. startrecord=true
  496. label=
  497. nodetype=8
  498. line1=address rexx_gpfax 'listen'
  499. line2=address rexx_gpfax 'sendfax' log.filename 'to' log.returnnumber
  500. line3=sendok = rc
  501. line4=address rexx_gpfax 'reportlog' 'T' 3
  502. line5=log.returnstatus = result
  503. line6=
  504. line7=
  505. line8=
  506. line9=
  507. line10=address rexx_gpfax 'unlisten'
  508. nextactiontype=3
  509. nextactionaction=
  510. endrecord=true
  511. startrecord=true
  512. label=isEFax
  513. nodetype=8
  514. line1=end; else if upper(faxprogram) = 'EFAX' then do
  515. line2=
  516. line3=
  517. line4=
  518. line5=
  519. line6=
  520. line7=
  521. line8=
  522. line9=
  523. line10=
  524. nextactiontype=3
  525. nextactionaction=
  526. endrecord=true
  527. startrecord=true
  528. label=
  529. nodetype=8
  530. line1=
  531. line2=/* now we need to find all files that match */
  532. line3=toSend = ''
  533. line4=
  534. line5=base = upper(voiceFile(mailbox, log.fileName) || '.');
  535. line6=do i = 1 to 999
  536. line7=  if exists(base || right(i, 3, '0')) then
  537. line8=    toSend = toSend base || right(i, 3, '0')
  538. line9=  else break
  539. line10=end
  540. nextactiontype=3
  541. nextactionaction=
  542. endrecord=true
  543. startrecord=true
  544. label=
  545. nodetype=8
  546. line1=
  547. line2=address command 'avm:gnu/efax -p' servername '-t' '"' || compress(numberToDial) || '"' toSend
  548. line3=if rc = 0 then sendOK = 0
  549. line4=else sendOK = 10
  550. line5=
  551. line6=
  552. line7=
  553. line8=
  554. line9=
  555. line10=
  556. nextactiontype=3
  557. nextactionaction=
  558. endrecord=true
  559. startrecord=true
  560. label=isNeither
  561. nodetype=8
  562. line1=end; else do
  563. line2=  log.returnStatus = 'Fax Prog?'
  564. line3=  log.returnRetry = 0
  565. line4=  call updateLogEntry(mailbox, magiccookie)
  566. line5=end
  567. line6=
  568. line7=
  569. line8=
  570. line9=
  571. line10=
  572. nextactiontype=3
  573. nextactionaction=
  574. endrecord=true
  575. startrecord=true
  576. label=sendFaxDone
  577. nodetype=8
  578. line1=if sendok < 5 then do; log.returnretry = 0; log.returnstatus = 'Sent OK'; end
  579. line2=else do; log.returnRetry = log.returnRetry - 1; log.time = cTime() + log.returnInterval * 60; end
  580. line3=call updateLogEntry(mailbox, magiccookie)
  581. line4=
  582. line5=
  583. line6=
  584. line7=
  585. line8=
  586. line9=
  587. line10=
  588. nextactiontype=3
  589. nextactionaction=
  590. endrecord=true
  591. startrecord=true
  592. label=
  593. nodetype=16
  594. timeout=5
  595. abortactiontype=0
  596. abortactionaction=stdabort
  597. erroractiontype=0
  598. erroractionaction=stderror
  599. nextactiontype=3
  600. nextactionaction=
  601. endrecord=true
  602. startrecord=true
  603. label=
  604. nodetype=11
  605. line1=AT+FCLASS=0
  606. timeout=2
  607. swallowecho=1
  608. timedoutactiontype=0
  609. timedoutactionaction=stdtimedout
  610. abortactiontype=0
  611. abortactionaction=stdabort
  612. erroractiontype=0
  613. erroractionaction=stderror
  614. nextactiontype=3
  615. nextactionaction=
  616. endrecord=true
  617. startrecord=true
  618. label=
  619. nodetype=10
  620. timeout=2
  621. valueactiontype=3
  622. valueactionaction=
  623. timedoutactiontype=0
  624. timedoutactionaction=stdtimedout
  625. abortactiontype=0
  626. abortactionaction=stdabort
  627. erroractiontype=0
  628. erroractionaction=stderror
  629. nextactiontype=3
  630. nextactionaction=
  631. endrecord=true
  632. startrecord=true
  633. label=
  634. nodetype=10
  635. timeout=2
  636. valueactiontype=3
  637. valueactionaction=
  638. timedoutactiontype=0
  639. timedoutactionaction=stdtimedout
  640. abortactiontype=0
  641. abortactionaction=stdabort
  642. erroractiontype=0
  643. erroractionaction=stderror
  644. nextactiontype=3
  645. nextactionaction=
  646. endrecord=true
  647. startrecord=true
  648. label=
  649. nodetype=14
  650. comment=We're done sending a fax
  651. nextactiontype=2
  652. nextactionaction=exit
  653. endrecord=true
  654. startrecord=true
  655. label=
  656. nodetype=7
  657. filename=avm:rexx/stdtail.avm
  658. nextactiontype=3
  659. nextactionaction=
  660. endrecord=true
  661.